﻿using System;
using System.Runtime.CompilerServices;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;

[RequireComponent(typeof(Toggle))]
public class UIFullScreenToggle : MonoBehaviour
{
    [CompilerGenerated]
    private static UnityAction<bool> <>f__am$cache1;
    private const string key = "Screenmanager Is Fullscreen mode";
    private Toggle toggle;

    private void Awake()
    {
        this.toggle = base.GetComponent<Toggle>();
        this.toggle.isOn = PlayerPrefs.GetInt("Screenmanager Is Fullscreen mode") == 1;
        if (<>f__am$cache1 == null)
        {
            <>f__am$cache1 = delegate (bool v) {
                Screen.SetResolution(Screen.width, Screen.height, v);
                PlayerPrefs.SetInt("Screenmanager Is Fullscreen mode", !v ? 0 : 1);
            };
        }
        this.toggle.onValueChanged.AddListener(<>f__am$cache1);
    }
}

